  var nodiac = { 'á': 'a', 'č': 'c', 'ď': 'd', 'ě': 'e', 'é':'e', 'í': 'i', 'ň': 'n', 'ó': 'o', 'ř': 'r', 'š': 's', 'ť': 't', 'ů': 'u', 'ú': 'u', 'ý': 'y', 'ž': 'z' };

  function make_url(s) {
      s = s.toLowerCase();
      var s2 = '';

      for (var i = 0; i < s.length; i++) {
          s2 += (typeof nodiac[s.charAt(i)] != 'undefined' ? nodiac[s.charAt(i)] : s.charAt(i));
      }

      return s2.replace(/[^a-z0-9_]+/g, '-').replace(/^-|-$/g, '');
  }

  function remove_fields(link, class_to_destroy) {
    $(link).prev("input[type=hidden]").val("1");
    //client_side_validations hack to avoid validation of removed fields
    //$(link).closest('.fields').find(":input:visible").remove();
    $(link).closest("." + class_to_destroy).hide();
  }

  function add_fields(link, association, content) {
    var new_id = new Date().getTime();
    var regexp = new RegExp("new_" + association, "g")
    $(link).parent().parent().before(content.replace(regexp, new_id));
  }

  function add_fields_for_property_attributes(link, association, content) {
    var new_id = new Date().getTime();
    var regexp = new RegExp("new_" + association, "g");
    $(link).parent().children('ol.property_attributes').children("li.property_attribute").last().after(content); //.replace(regexp, new_id)
  }